/*
 *  $Id: RagimaTheEarth.cs 1067 2010-05-21 11:00:43Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Earth.Creatures {
    public class RagimaTheEarth: RagimaCreatureCard {
        public RagimaTheEarth() : base("001_e_c_r_the_earth", ElementType.Earth) {
            Level = CompleteLevel.ReadyForTest;
            Value = 100;
        }
        public override void SetNaturalAffects(ICollector<Affect> affects) {
            affects.Add<Affects.FlightBlock>();
            affects.Add<Affects.MassBlock>();
            affects.Add(new Affects.ModTakenDamage(DamageType.PhysicalAttack, -3));
            affects.Add(new Affects.Regeneration(6));
            affects.Add(new Affects.FinishKill(5));
            affects.Add<RagimaTheEarthAura>();
        }

        private class RagimaTheEarthAura: AuraAffect {
            public RagimaTheEarthAura(): base(true, false) {}

            public override string Id {
                get { return AffectManager.GetCardId<RagimaTheEarth>("aura"); }
            }

            public override int AverageWeightPercent {
                get { return 300; }
            }

            protected override bool AcceptAura(AbstractObject obj) {
                return AcceptOwner(obj) && obj is Land;
            }

            protected override Affect CreateSubAffect() {
                return new RagimaTheEarthAffect();
            }
        }

        private class RagimaTheEarthAffect: SpellAffect<RagimaTheEarth> {
            public RagimaTheEarthAffect(): base(true) {
                DefaultDescription = true;
                Add(new Affects.Antimagic());
            }
        }
    }
}
